package com.ticket.service.impl;

import com.ticket.dao.DramaDao;
import com.ticket.dao.impl.DramaDaoImpl;
import com.ticket.entity.Drama;
import com.ticket.service.DramaService;
import com.ticket.util.MybatisUtil;
import com.ticket.util.Page;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author twj
 * @version 8.0
 * @description TODO
 * @date 2023/10/7
 */
public class DramaServiceImpl implements DramaService {
    static DramaDao dd;
    static{
        SqlSession session= MybatisUtil.getSqlSession();
        dd=session.getMapper(DramaDao.class);
    }
    /**
    * @author TanWenJie
    * @description TODO 分页查询演出活动表
    * @date 2023/10/7 11:01
     * @param page
     * @param drama
    * @return org.t69.auction.Page<com.ticket.entity.Drama>
    */
    @Override
    public Page<Drama> selDramaPage(Page page, Drama drama)
    {
        List<Drama> dramaPage= dd.selDramaPage(page, drama);
        int dramaPageCount= dd.selDramaPageCount(drama);
        page.setTotalCount(dramaPageCount);
        page.setDataList(dramaPage);
        return page;
    }
}
